import request from '@/utils/request'

// @Tags api
// @Summary 获取用户列表
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body modelInterface.PageInfo true "用户登录"
// @Success 200 {string} json "{"code":0,"data":{},"msg":"获取成功"}"
// @Router /api/user/list [post]
export const getUserList = (data) => {
  return request({
    url: '/api/user/list',
    method: 'Post',
    data
  })
}

// @Tags api
// @Summary 删除用户
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body modelInterface.PageInfo true "删除用户"
// @Success 200 {string} json "{"code":0,"msg":"获取成功"}"
// @Router /api/user/delete/${userId} [get]
export const deleteUser = (userId) => {
  return request({
    url: `/api/user/delete/${userId}`,
    method: 'Get',
  })
}

// @Tags api
// @Summary 重置密码
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body modelInterface.PageInfo true ""重置密码
// @Success 200 {string} json "{"code":0,"msg":"获取成功"}"
// @Router /api/user/password/reset [get]
export const resetPassword = (data) => {
  return request({
    url: '/api/user/password/reset',
    method: 'Post',
    data
  })
}

// @Tags api
// @Summary 查看日志
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body modelInterface.PageInfo true ""查看日志
// @Success 200 {string} json "{"code":0,"msg":"获取成功"}"
// @Router /api/user/logs [post]
export const lookintoLog = (data) => {
  return request({
    url: '/api/user/logs',
    method: 'Post',
    data
  })
}

// @Tags api
// @Summary 编辑用户
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body modelInterface.PageInfo true "编辑用户"
// @Success 200 {string} json "{"code":0,"msg":"获取成功"}"
// @Router /api/user/update [post]
export const updateUser = (data) => {
  return request({
    url: '/api/user/update',
    method: 'Post',
    data
  })
}

// @Tags api
// @Summary 新增用户
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body modelInterface.PageInfo true "新增用户"
// @Success 200 {string} json "{"code":0,"msg":"获取成功"}"
// @Router /api/user/add [post]
export const addUser = (data) => {
  return request({
    url: '/api/user/add',
    method: 'Post',
    data
  })
}

